package com.j4dream.testRegex;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class RegexTest {
	public static void main(String[] arg) {
		List<String> dbString = new ArrayList<String>();
		dbString.add("dddd我们的歌");
		dbString.add("我们的歌");
		dbString.add("bcddd");
		String queryString = "我们";
		Pattern pat = Pattern.compile("\\b" + queryString);
		for (String dbs : dbString) {
			Matcher matcher = pat.matcher(dbs);
			if (matcher.find()) {
				System.out.println(dbs);
			}
		}

	}
}
